#define _CRT_SECURE_NO_WARNINGS
int fib(int n);
#include<stdio.h>
int main() {
	int n = 20;
	int sum=fib(n);
	printf("%d\n", sum);
	return 0;
}

int fib(int n) {
	if (n <= 1)
		return n;

	int prv = 0, cur = 1;

	for (int i = 2; i <= n; i++) {
		int next = prv + cur;

		prv = cur;
		cur = next;
	}

	return cur;
}